翻訳と辞書
Words near each other
・ Factory Girl (2013 film)
・ Factory Girl (film)
・ Factory Girl (folk song)
・ Factory Girl (The Rolling Stones song)
・ Factory Girl (TV series)
・ Factory Girls
・ Factory glass
・ Factory Green
・ Factory Hill
・ Factory House
・ Factory inspector
・ Factory Instrumentation Protocol
・ Factory Island 1, Ontario
・ Factory leader
・ Factory mark
Factory method pattern
・ Factory name
・ Factory Orders
・ Factory overhead
・ Factory Physics
・ Factory Point
・ Factory Point, Virginia
・ Factory Records
・ Factory Records discography
・ Factory reset
・ Factory second
・ Factory Shanghai
・ Factory ship
・ Factory Shop
・ Factory Showroom


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Factory method pattern : ウィキペディア英語版
Factory method pattern
In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. This is done by creating objects by calling a factory method—either specified in an interface and implemented by child classes, or implemented in a base class and optionally overridden by derived classes—rather than by calling a constructor.
==Definition==
The factory method pattern should ''not'' be confused with the more general notion of factories and factory methods. The factory method pattern is the best-known use of factories and factory methods, but not all uses of factory methods are examples of the factory method pattern – only when inheritance is involved (a class implementing an interface, or derived class, implements a factory method) is it an example of the factory method pattern. More basic uses of factories are not examples of the factory method pattern, and may instead be referred to as the ''factory pattern''〔"(Factory Pattern )", (OODesign.com )〕 or a ''simple factory;''〔(Chapter 4. The Factory Pattern: Baking with OO Goodness ): (The Simple Factory defined )〕 these are discussed at factory.
Factory Method define an interface for creating an object, but let subclasses decide which class to instantiate. The Factory method lets a class defer instantiation to subclasses.〔''Design Patterns: Elements of Reusable Object-Oriented Software'' from the ''Gang Of Four''〕
Creating an object often requires complex processes not appropriate to include within a composing object. The object's creation may lead to a significant duplication of code, may require information not accessible to the composing object, may not provide a sufficient level of abstraction, or may otherwise not be part of the composing object's concerns. The factory method design pattern handles these problems by defining a separate method for creating the objects, which subclasses can then override to specify the derived type of product that will be created.
The factory method pattern relies on inheritance, as object creation is delegated to subclasses that implement the factory method to create objects.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Factory method pattern」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.